function setcity() {
    var SelP=document.getElementsByName(arguments[0])[0];
    var SelC=document.getElementsByName(arguments[1])[0];
    var DefP=arguments[2];
    var DefC=arguments[3];var provinceOptions = new Array("请选择省份",0,"北京",1,"上海",2,"天津",3,"重庆",4,"广东",5,"福建",6,"浙江",7,"江苏",8,"山东",9,"辽宁",10,"江西",11,"四川",12,"陕西",13,"湖北",14,"河南",15,"河北",16,"山西",17,"内蒙古",18,"吉林",19,"黑龙江",20,"安徽",21,"湖南",22,"广西",23,"海南",24,"云南",25,"贵州",26,"西藏",27,"甘肃",28,"宁夏区",29,"青海",30,"新疆",31,"香港",32,"澳门",33,"台湾",34,"海外",60 );
    SelP.options.length = 0;     
    for(var i = 0; i < provinceOptions.length/2; i++) {
        SelP.options[i]=new Option(provinceOptions[i*2],provinceOptions[i*2+1]);
        if(SelP.options[i].value==DefP) {
            SelP.selectedIndex = i;
        }
    }

    SelP.onchange = function(){
        switch (SelP.value) {case "1" :
var cityOptions = new Array("东城区",101,"西城区",102,"崇文区",103,"宣武区",104,"朝阳区",105,"海淀区",106,"丰台区",107,"石景山区",108,"门头沟区",109,"房山区",110,"通区",111,"顺义区",112,"昌平区",113,"大兴区",114,"平谷县",115,"怀柔县",116,"密云县",117,"延庆县",118 );
 break;
case "2" :
var cityOptions = new Array("黄浦区",201,"卢湾区",202,"徐汇区",203,"长宁区",204,"静安区",205,"普陀区",206,"闸北区",207,"虹口区",208,"杨浦区",209,"宝山区",210,"闵行区",211,"嘉定区",212,"浦东新区",213,"松江区",214,"金山区",215,"青浦区",216,"南汇区",217,"奉贤区",218,"崇明县",219 );
 break;
case "3" :
var cityOptions = new Array("和平区",301,"河东区",302,"河西区",303,"南开区",304,"河北区",305,"红桥区",306,"塘沽区",307,"汉沽区",308,"大港区",309,"东丽区",310,"西青区",311,"北辰区",312,"津南区",313,"武清区",314,"宝坻区",315,"静海县",316,"宁河县",317,"蓟县",318 );
 break;
case "4" :
var cityOptions = new Array("渝中区",401,"大渡口区",402,"江北区",403,"沙坪坝区",404,"九龙坡区",405,"南岸区",406,"北碚区",407,"万盛区",408,"双桥区",409,"渝北区",410,"巴南区",411,"万区",412,"涪陵区",413,"黔江区",414,"永川",415,"合川",416,"江津",417,"南川",418,"长寿县",419,"綦江县",420,"潼南县",421,"荣昌县",422,"璧山县",423,"大足县",424,"铜梁县",425,"梁平县",426,"城口县",427,"垫江县",428,"武隆县",429,"丰都县",430,"奉节县",431,"开县",432,"云阳县",433,"忠县",434,"巫溪县",435,"巫山县",436,"石柱县",437,"秀山县",438,"酉阳县",439,"彭水县",440 );
 break;
case "5" :
var cityOptions = new Array("广州",501,"深圳",502,"珠海",503,"汕头",504,"韶关",505,"河源",506,"梅州",507,"惠州",508,"汕尾",509,"东莞",510,"中山",511,"江门",512,"佛山",513,"阳江",514,"湛江",515,"茂名",516,"肇庆",517,"清远",518,"潮州",519,"揭阳",520,"云浮",521 );
 break;
case "6" :
var cityOptions = new Array("福州",601,"厦门",602,"三明",603,"莆田",604,"泉州",605,"漳州",606,"南平",607,"龙岩",608,"宁德",609 );
 break;
case "7" :
var cityOptions = new Array("杭州",701,"宁波",702,"温州",703,"嘉兴",704,"湖州",705,"绍兴",706,"金华",707,"衢州",708,"舟山",709,"台州",710,"丽水",711 );
 break;
case "8" :
var cityOptions = new Array("南京",801,"徐州",802,"连云港",803,"淮安",804,"宿迁",805,"盐城",806,"扬州",807,"泰州",808,"南通",809,"镇江",810,"常州",811,"无锡",812,"苏州",813 );
 break;
case "9" :
var cityOptions = new Array("济南",901,"青岛",902,"淄博",903,"枣庄",904,"东营",905,"潍坊",906,"烟台",907,"威海",908,"济宁",909,"泰安",910,"日照",911,"莱芜",912,"德州",913,"临沂",914,"聊城",915,"滨州",916,"菏泽",917 );
 break;
case "10" :
var cityOptions = new Array("沈阳",1001,"大连",1002,"鞍山",1003,"抚顺",1004,"本溪",1005,"丹东",1006,"锦州",1007,"葫芦岛",1008,"营口",1009,"盘锦",1010,"阜新",1011,"辽阳",1012,"铁岭",1013,"朝阳",1014 );
 break;
case "11" :
var cityOptions = new Array("南昌",1101,"景德镇",1102,"萍乡",1103,"新余",1104,"九江",1105,"鹰潭",1106,"赣州",1107,"吉安",1108,"宜春",1109,"抚州",1110,"上饶",1111 );
 break;
case "12" :
var cityOptions = new Array("成都",1201,"自贡",1202,"攀枝花",1203,"泸州",1204,"德阳",1205,"绵阳",1206,"广元",1207,"遂宁",1208,"内江",1209,"乐山",1210,"南充",1211,"宜宾",1212,"广安",1213,"达州",1214,"巴中",1215,"雅安",1216,"眉山",1217,"资阳",1218,"阿坝",1219,"甘孜",1220,"凉山",1221 );
 break;
case "13" :
var cityOptions = new Array("铜川",1302,"宝鸡",1303,"咸阳",1304,"渭南",1305,"延安",1306,"汉中",1307,"榆林",1308,"安康",1309,"商洛地区",1310,"西安",3114 );
 break;
case "14" :
var cityOptions = new Array("武汉",1401,"黄石",1402,"襄樊",1403,"十堰",1404,"荆州",1405,"宜昌",1406,"荆门",1407,"鄂州",1408,"孝感",1409,"黄冈",1410,"咸宁",1411,"随州",1412,"仙桃",1413,"天门",1414,"潜江",1415,"神农架",1416,"恩施",1417 );
 break;
case "15" :
var cityOptions = new Array("郑州",1501,"开封",1502,"洛阳",1503,"平顶山",1504,"焦作",1505,"鹤壁",1506,"新乡",1507,"安阳",1508,"濮阳",1509,"许昌",1510,"漯河",1511,"三门峡",1512,"南阳",1513,"商丘",1514,"信阳",1515,"周口",1516,"驻马店",1517,"济源",1518 );
 break;
case "16" :
var cityOptions = new Array("石家庄",1601,"唐山",1602,"秦皇岛",1603,"邯郸",1604,"邢台",1605,"保定",1606,"张家口",1607,"承德",1608,"沧州",1609,"廊坊",1610,"衡水",1611 );
 break;
case "17" :
var cityOptions = new Array("太原",1701,"大同",1702,"阳泉",1703,"长治",1704,"晋城",1705,"朔州",1706,"晋中",1707,"忻州",1708,"临汾",1709,"运城",1710,"吕梁地区",1711 );
 break;
case "18" :
var cityOptions = new Array("呼和浩特",1801,"包头",1802,"乌海",1803,"赤峰",1804,"通辽",1805,"鄂尔多斯",1806,"乌兰察布",1807,"锡林郭勒",1808,"呼伦贝尔",1809,"巴彦淖尔",1810,"阿拉善盟",1811,"兴安盟",1812 );
 break;
case "19" :
var cityOptions = new Array("长春",1901,"吉林",1902,"四平",1903,"辽源",1904,"通化",1905,"白山",1906,"松原",1907,"白城",1908,"延边",1909 );
 break;
case "20" :
var cityOptions = new Array("哈尔滨",2001,"齐齐哈尔",2002,"鹤岗",2003,"双鸭山",2004,"鸡西",2005,"大庆",2006,"伊春",2007,"牡丹江",2008,"佳木斯",2009,"七台河",2010,"黑河",2011,"绥化",2012,"大兴安岭",2013 );
 break;
case "21" :
var cityOptions = new Array("合肥",2101,"芜湖",2102,"蚌埠",2103,"淮南",2104,"马鞍山",2105,"淮北",2106,"铜陵",2107,"安庆",2108,"黄山",2109,"滁州",2110,"阜阳",2111,"宿州",2112,"巢湖",2113,"六安",2114,"亳州",2115,"宣城",2116,"池州",2117 );
 break;
case "22" :
var cityOptions = new Array("长沙",2201,"株州",2202,"湘潭",2203,"衡阳",2204,"邵阳",2205,"岳阳",2206,"常德",2207,"张家界",2208,"益阳",2209,"郴州",2210,"永州",2211,"怀化",2212,"娄底",2213,"湘西",2214 );
 break;
case "23" :
var cityOptions = new Array("南宁",2301,"柳州",2302,"桂林",2303,"梧州",2304,"北海",2305,"防城港",2306,"钦州",2307,"贵港",2308,"玉林",2309,"南宁地区",2310,"柳地区",2311,"贺地区",2312,"百色地区",2313,"河池地区",2314 );
 break;
case "24" :
var cityOptions = new Array("海口",2401,"三亚",2402,"五指山",2403,"琼海",2404,"儋州",2405,"琼山",2406,"文昌",2407,"万宁",2408,"东方",2409,"澄迈县",2410,"定安县",2411,"屯昌县",2412,"临高县",2413,"白沙县",2414,"昌江县",2415,"乐东县",2416,"陵水县",2417,"保亭县",2418,"琼中县",2419 );
 break;
case "25" :
var cityOptions = new Array("昆明",2501,"曲靖",2502,"玉溪",2503,"保山",2504,"昭通",2505," 普洱",2506,"临沧",2507,"丽江",2508,"文山",2509,"红河",2510,"西双版纳",2511,"楚雄",2512,"大理",2513,"德宏",2514,"怒江",2515,"迪庆",2516 );
 break;
case "26" :
var cityOptions = new Array("贵阳",2601,"六盘水",2602,"遵义",2603,"安顺",2604,"铜仁地区",2605,"毕节地区",2606,"黔西南",2607,"黔东南",2608,"黔南",2609 );
 break;
case "27" :
var cityOptions = new Array("拉萨",2701,"那曲地区",2702,"昌都地区",2703,"山南地区",2704,"日喀则",2705,"阿里地区",2706,"林芝地区",2707 );
 break;
case "28" :
var cityOptions = new Array("兰州",2801,"金昌",2802,"白银",2803,"天水",2804,"嘉峪关",2805,"武威",2806,"定西地区",2807,"平凉地区",2808,"庆阳地区",2809,"陇南地区",2810,"张掖地区",2811,"酒泉地区",2812,"甘南",2813,"临夏",2814 );
 break;
case "29" :
var cityOptions = new Array("银川",2901,"石嘴山",2902,"吴忠",2903,"固原",2904 );
 break;
case "30" :
var cityOptions = new Array("西宁",3001,"海东地区",3002,"海北",3003,"黄南",3004,"海南",3005,"果洛",3006,"玉树",3007,"海西",3008 );
 break;
case "31" :
var cityOptions = new Array("乌鲁木齐",3101,"克拉玛依",3102,"石河子",3103,"吐鲁番",3104,"哈密地区",3105,"和田地区",3106,"阿克苏",3107,"喀什地区",3108,"克孜勒苏",3109,"巴音郭楞",3110,"昌吉",3111,"博尔塔拉",3112,"伊犁",3113 );
 break;
case "32" :
var cityOptions = new Array("香港岛",3201,"九龙",3202,"新界",3203 );
 break;
case "33" :
var cityOptions = new Array("澳门半岛",3301,"离岛",3302 );
 break;
case "34" :
var cityOptions = new Array("台北",3401,"高雄",3402,"台南",3403,"台中",3404,"金门县",3405,"南投县",3406,"基隆",3407,"新竹",3408,"嘉义",3409,"新北",3410,"宜兰县",3411,"新竹县",3412,"桃园县",3413,"苗栗县",3414,"彰化县",3415,"嘉义县",3416,"云林县",3417,"屏东县",3418,"台东县",3419,"花莲县",3420,"澎湖县",3421 );
 break;
case "60" :
var cityOptions = new Array("美国",6001,"英国",6002,"法国",6003,"俄罗斯",6004,"加拿大",6005,"巴西",6006,"澳大利亚",6007,"印尼",6008,"马来西亚",6009,"新加坡",6010,"菲律宾",6011,"越南",6012,"印度",6013,"日本",6014,"韩国",6015,"泰国",6016,"缅甸",6017,"其他",6018 );
 break;
        default:
            var cityOptions = new Array("");
            break;
        }

        SelC.options.length = 0;     
        for(var i = 0; i < cityOptions.length/2; i++) {
            SelC.options[i]=new Option(cityOptions[i*2],cityOptions[i*2+1]);
            if (SelC.options[i].value==DefC) {
                SelC.selectedIndex = i;
            }
        }  
    } 

    if (DefP) {
        if(SelP.fireEvent) {
        SelP.fireEvent('onchange');
        //alert('ok');
        }else {
            SelP.onchange();
        }
    }    

}